<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>

	<h:outputStylesheet library="css" name="login-style.css" />
	<title>Регистрация</title>

</h:head>

<h:body>
	<div id="wraper">
		<div id="header">
			<h1>
				<h:outputText value="Registration" />
			</h1>
		</div>
		<div id="registration">
			<h:form id="registration-form">
				<h:outputText value="#{registration.warning}" styleClass="warning" />
				<table>
					<tr>
						<td>
							<h:outputText value="Username:" />
						</td>
						<td>
							<h:inputText label="Username" id="username"
								value="#{registration.username}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="15" />
							</h:inputText>
						</td>
						<td>
							<h:message for="username" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Email:" />
						</td>
						<td>
							<h:inputText label="email" id="email"
								value="#{registration.email}"
								requiredMessage="*Field is required" required="true"
								validator="#{registration.validateEmail}" />
						</td>
						<td>
							<h:message for="email" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Password:" />
						</td>
						<td>
							<h:inputSecret id="password" value="#{registration.password}"
								requiredMessage="*Field is required"
								validatorMessage="*Length is less than allowable minimum of '5'"
								required="true">
								<f:validateLength minimum="5" maximum="15" />
							</h:inputSecret>
						</td>
						<td>
							<h:message for="password" styleClass="warning" />
						</td>
					</tr>
					<tr>
						<td>
							<h:outputText value="Repeat password:" />
						</td>
						<td>
							<h:inputSecret id="repeat-password"
								value="#{registration.repeatPassword}" required="true"
								requiredMessage="*Field is required"
								validator="#{registration.passwordValidator}" />
						</td>
						<td>
							<h:message for="repeat-password" styleClass="warning" />
						</td>
					</tr>
				</table>
				<h:commandButton value="Register" action="#{registration.register}" styleClass="buttonRegister" />
				<h:commandButton value="Back" action="login" immediate="true" styleClass="buttonBack" />
			</h:form>
		</div>
		<div id="footer"></div>
	</div>
</h:body>

</html>